package com.qiwenshare.ufop.util;

import java.security.SecureRandom;
import java.util.logging.Logger;

public class PasswordUtil {

    static Logger logger = Logger.getLogger(PasswordUtil.class.getName());

    private PasswordUtil() {
        throw new UnsupportedOperationException("Cannot instantiate utility class");
    }

    public static String getSaltValue() {
        SecureRandom secureRandom = new SecureRandom();
        StringBuilder sb = new StringBuilder(16);
        while (sb.length() < 16) {
            sb.append(secureRandom.nextInt(10));
        }
        return sb.toString();
    }

    public static void main(String[] args) {
        for (int i = 0; i < 5; i++) {
            logger.info(PasswordUtil.getSaltValue());
        }
    }
}
